<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/FoodSageTemplate.xhtml">

    <ui:define name="logout">
        <p:commandLink id="logoutLink" actionListener="#{touristLogoutManagedBean.doLogout}" value="#{bundle['login.logout.label']}" ajax="false" immediate="true" />
    </ui:define>

    <ui:define name="main_menu">
        <f:view beforePhase="#{itineraryViewAllTripItinerariesManagedBean.initView}"/>
        <p:menubar model="#{itineraryViewAllTripItinerariesManagedBean.touristMainMenuModel}"/>
    </ui:define>

    <ui:define name="nav_menu">
        <p:menu model="#{itineraryViewAllTripItinerariesManagedBean.touristNavMenuModel}"/>
    </ui:define>

    <ui:define name="content">
        
        <p:panel id="allTripItineraryDetail" header="#{bundle['tripItinerary.headerViewAll.panel']}"  >
            <p:messages id="statusMessages" redisplay="false" />

            <p:dataTable var="tripItinerary" value="#{itineraryViewAllTripItinerariesManagedBean.tripItinerariesList}"  
                         paginator="true" rows="10"  
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                         rowsPerPageTemplate="5,10,15">  


                <f:facet name="header">  
                    <h:outputText value="#{bundle['itinerary.myTripItineraries.header']}"/>
                </f:facet>  

                <p:column sortBy="#{tripItinerary.itineraryName}" filterBy="#{tripItinerary.itineraryName}" >  
                    <f:facet name="header">  
                        <h:outputText value="#{bundle['tripItinerary.itineraryName.label']}" />  
                    </f:facet>  
                    <h:outputText value="#{tripItinerary.itineraryName}" />  
                </p:column>  

                <p:column sortBy="#{tripItinerary.localizedArrivalDate}" filterBy="#{tripItinerary.localizedArrivalDate}" >  
                    <f:facet name="header">  
                        <h:outputText value="#{bundle['tripItinerary.arrivalDate.label']}" />  
                    </f:facet>  
                    <h:outputText value="#{tripItinerary.localizedArrivalDate}" />  
                </p:column>  

                <p:column sortBy="#{tripItinerary.localizedDepartureDate}" filterBy="#{tripItinerary.localizedDepartureDate}" >  
                    <f:facet name="header">  
                        <h:outputText value="#{bundle['tripItinerary.departureDate.label']}" />  
                    </f:facet>  
                    <h:outputText value="#{tripItinerary.localizedDepartureDate}" />  
                </p:column> 

                <p:column>
                    <p:commandButton value="#{bundle['tripItinerary.view.button']}" update="statusMessages" actionListener="#{itineraryViewAllTripItinerariesManagedBean.viewTripItineraryView(tripItinerary)}" image="ui-icon ui-icon-pencil" />
                    <p:commandButton value="#{bundle['tripItinerary.delete.button']}" update="statusMessages" actionListener="#{itineraryViewAllTripItinerariesManagedBean.viewTripItineraryDelete(tripItinerary)}" image="ui-icon ui-icon-trash" />
                </p:column>

            </p:dataTable>
        </p:panel>
    </ui:define>  

</ui:composition>

